﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ViewWages.aspx.cs" Inherits="Wage_wages" %>
<%@ Register Src="../usercontrol/PageNavigator.ascx" TagName="PageNavigator" TagPrefix="uc1" %>
<html>
<head runat="server">
<link href="../css/adminCss.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../js/changerows.js"></script>
 <script type="text/javascript" src="../js/rl.js"></script>
 <script type="text/javascript">
    
     function PrintData(WageId)
    {
        if(WageId!="")
        {
  
            window.open("DrawPrint.aspx?WageId="+WageId+"","","width=800px,height=650px,left=100px,top=30px,scrollbars=yes");
            return false;
        }
        return false;
    }
    function AllPrintData(WageId,gettim1,gettim2,name,selectId)
    {
        if(WageId=="All")
        {

            window.open("AllDrawPrint.aspx?WageId="+WageId+"","","width=800px,height=650px,left=100px,top=30px,scrollbars=yes");
            return false;
        }
       else
       {
             window.open("AllDrawPrint.aspx?WageId="+WageId+"&gettim1="+gettim1+"&gettim2="+gettim2+"&name="+name+"&selectId="+selectId+"","","width=800px,height=650px,left=100px,top=30px,scrollbars=yes");
            return false;
       }

        return false;
      
    }
     function AllPrintData1(WageId,gettim1,gettim2,name,selectId)
    {
        if(WageId=="All")
        {

            window.open("AllDrawPrint1.aspx?WageId="+WageId+"","","width=800px,height=650px,left=100px,top=30px,scrollbars=yes");
            return false;
        }
       else
       {
             window.open("AllDrawPrint1.aspx?WageId="+WageId+"&gettim1="+gettim1+"&gettim2="+gettim2+"&name="+name+"&selectId="+selectId+"","","width=800px,height=650px,left=100px,top=30px,scrollbars=yes");
            return false;
       }

        return false;
      
    }
   function AllPrintData2(WageId,gettim1,gettim2,name,selectId)
    {
        if(WageId=="All")
        {

            window.open("AllDrawPrint2.aspx?WageId="+WageId+"","","width=800px,height=650px,left=100px,top=30px,scrollbars=yes");
            return false;
        }
       else
       {
             window.open("AllDrawPrint2.aspx?WageId="+WageId+"&gettim1="+gettim1+"&gettim2="+gettim2+"&name="+name+"&selectId="+selectId+"","","width=800px,height=650px,left=100px,top=30px,scrollbars=yes");
            return false;
       }

        return false;
      
    }
    function CheckAll(form) {
	    for (var i=0;i<form.elements.length;i++) {
		    var e = form.elements[i];
		    if (e.name != 'chkall' && e.type=='checkbox')
			    e.checked = form.chkall.checked;
	    }
    }
    
    </script>
    <title>工资管理</title>
</head>
<body>
    <form id="form1" runat="server">
   <table width="99%" border="0" cellpadding="0" cellspacing="0">
        <tr> 
    <td height="22"><img src="../images/module.gif" width="20" height="22">&nbsp;<asp:Label ID="lblwz" runat="server" height="22"></asp:Label></td>
   
    <td style=" text-align: right;"><asp:LinkButton ID="Linkcannel" ForeColor="red" runat="server" OnClick="Linkcannel_Click">[返回]</asp:LinkButton>
        </td>
    </tr>
     <tr>
    <td width="990" align="center" style="text-align:right " colspan="2"><img src="../images/search.gif" alt="搜索" width="16" height="16"/>业绩时间：<asp:TextBox ID="yjTm1" runat="server" CssClass="input1" Width="120px"></asp:TextBox>
    到
    <asp:TextBox
            ID="yjTm2" runat="server" CssClass="input1" Width="120px"　></asp:TextBox>
            姓名：<asp:TextBox
            ID="txtselecName" runat="server" CssClass="input1" Width="120px"　></asp:TextBox>
        部门：<asp:DropDownList ID="ddrDepartment" runat="server">
        </asp:DropDownList>
        
      <asp:Button ID="btnSelec" runat="server" Text="搜索" CssClass="submit" CausesValidation="False" OnClick="btnSelec_Click"/></td>
  </tr>
</table>
<table width="99%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td bgcolor="#3CB6E5" height="5px"></td>
  </tr>
</table>
        <asp:GridView ID="GvDataVW" runat="server" CssClass="gridview" Width="99%" AutoGenerateColumns="False"
             RowStyle-HorizontalAlign="center" EmptyDataText="没有数据" OnRowDataBound="GvDataVW_RowDataBound" >
              <RowStyle Height="23px" />
            <Columns>
                <asp:BoundField DataField="WagesId" HeaderText="工资ID" />
                <asp:BoundField DataField="WStaffName" HeaderText="员工姓名" />
                <asp:BoundField DataField="department" HeaderText="所属部门" />
                <asp:TemplateField HeaderText="基本工资(元)">
                    <ItemTemplate>
                        <asp:Label ID="WStaffSalary" runat="server" Text= '<%# Bind("WStaffSalary","{0:f2}") %>'></asp:Label>
                    </ItemTemplate>
                   
                    </asp:TemplateField>
              <%-- <asp:TemplateField HeaderText="员工奖金(元)">
                    <ItemTemplate>
                        <asp:Label ID="WStaffPrice" runat="server" Text= '<%# Bind("WStaffPrice","{0:f2}") %>'></asp:Label>
                    </ItemTemplate>
                   
                    </asp:TemplateField>--%>
                    <asp:BoundField DataField="comodName" HeaderText="所卖商品" />
                     <asp:BoundField DataField="modul" HeaderText="类型" />
                <asp:BoundField DataField="WStaffPercentage" HeaderText="员工提成(%)" />
                 <asp:TemplateField HeaderText="员工业绩(元)">
                    <ItemTemplate>
                        <asp:Label ID="WStaffPerformance" runat="server" Text= '<%# Bind("WStaffPerformance","{0:f2}") %>'></asp:Label>
                    </ItemTemplate>
                   
                    </asp:TemplateField>
               <asp:TemplateField HeaderText="应发工资(元)">
                    <ItemTemplate>
                        <asp:Label ID="WYWage" runat="server" Text= '<%# Bind("WYWage","{0:f2}") %>'></asp:Label>
                    </ItemTemplate>
                   
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="扣除工资(元)">
                    <ItemTemplate>
                        <asp:Label ID="WDiscount" runat="server" Text= '<%# Bind("WDiscount","{0:f2}") %>'></asp:Label>
                    </ItemTemplate>
                   
                    </asp:TemplateField>
               <asp:TemplateField HeaderText="实发工资(元)">
                    <ItemTemplate>
                        <asp:Label ID="WSWage" runat="server" Text= '<%# Bind("WSWage","{0:f2}") %>'></asp:Label>
                    </ItemTemplate>
                   
                    </asp:TemplateField>
                <asp:BoundField DataField="WageDate" HeaderText="业绩日期" />
                <asp:BoundField DataField="AuditUserName" HeaderText="结算人" />
                <asp:TemplateField HeaderText="操作">
                    <ItemTemplate>
                      <asp:LinkButton ID="linkbtnSales" CssClass="lnkbtn" ForeColor="Red" runat="server" CommandArgument='<%#Eval("WagesId")+"|"+Eval("WageDate") %>' OnClick="linkbtnSales_Click"  >修改</asp:LinkButton>
                        <asp:LinkButton ID="lnkbtnClearing" CssClass="lnkbtn" ForeColor="Red" runat="server" CommandArgument='<%#Eval("WagesId")%>' OnClick="lnkbtnClearing_Click"  >打印</asp:LinkButton>
                        
                    </ItemTemplate>
                
                </asp:TemplateField>
              <asp:TemplateField HeaderText="选择"><ItemTemplate>
                    
                    <asp:CheckBox ID="chkDelete"  runat="server" />
                </ItemTemplate>
                    <ItemStyle Width="40px" />
                </asp:TemplateField>

            </Columns>
            <RowStyle HorizontalAlign="Center" />
            <EmptyDataRowStyle ForeColor="Red" HorizontalAlign="Center" />
        </asp:GridView>
        <table width="99%" border="0" cellspacing="0" cellpadding="0">
        <tr>
        <td>
                </td>
                <td align="right">
                  <uc1:PageNavigator ID="PageNavigator1" runat="server" DataId="GvDataVW" ConnectionString="connstr" ShowType="Text" PageSize="7" />
                </td>
           <td height="5" align="right">
           <input type="checkbox" name="chkall"  onclick="CheckAll(this.form)" value="on"><font color="#FF0000">全选</font>&nbsp;
            <asp:Button  ID="btnPrint" runat="server" Text="按天打印" CssClass="submit" UseSubmitBehavior="False" OnClick="btnPrint_Click"  />
            <asp:Button  ID="btnPrintm" runat="server" Text="按月打印" CssClass="submit" UseSubmitBehavior="False" OnClick="btnPrintm_Click"   />
            <asp:Button  ID="btnalPrints" runat="server" Text="打印" CssClass="submit" UseSubmitBehavior="False" OnClick="btnalPrints_Click"  />
            <asp:Button  ID="btndel" runat="server" Text="删除" CssClass="submit" OnClientClick="return confirm('确定要删除吗?')" OnClick="btndel_Click"   />
        
        </td>
      </tr>
      </table>
         
       <asp:HiddenField ID="hfxs" runat="server" />
        <asp:GridView ID="GridViewselectday" runat="server" CssClass="gridview" Width="99%" AutoGenerateColumns="False"
             RowStyle-HorizontalAlign="center" EmptyDataText="没有数据">
             <RowStyle Height="23px" />
             <Columns>
             <asp:BoundField DataField="WStaffName" HeaderText="员工姓名" />
             <asp:BoundField DataField="department" HeaderText="所属部门" />
              <asp:TemplateField HeaderText="该天工资(元)">
                    <ItemTemplate>
                        <asp:Label ID="daytol" runat="server" Text= '<%# Bind("daytol","{0:f2}") %>'></asp:Label>
                    </ItemTemplate>
                   
                    </asp:TemplateField>
             <asp:BoundField DataField="WageDate" HeaderText="业绩时间" />
             </Columns>
        </asp:GridView>
        &nbsp;
        &nbsp;&nbsp; &nbsp;
        <table width="99%" border="0" cellspacing="0" cellpadding="0">
        <tr>
        <td >
                </td>
                <td align="right">
       <uc1:PageNavigator ID="PageNavigator2" runat="server" DataId="GridViewselectday" ConnectionString="connstr" ShowType="Text" PageSize="5" />
        <asp:HiddenField ID="hfcheck" runat="server" />
        </td>
        </tr>
        </table>
        <asp:GridView ID="GridViewM" runat="server" CssClass="gridview" Width="99%" AutoGenerateColumns="False"
             RowStyle-HorizontalAlign="center" EmptyDataText="没有数据">
             <RowStyle Height="23px" />
             <Columns>
             <asp:BoundField DataField="WStaffName" HeaderText="员工姓名">
             
             </asp:BoundField>
             <asp:BoundField DataField="department" HeaderText="所属部门"> 
              </asp:BoundField>
               <asp:TemplateField HeaderText="基本工资(元)">
                    <ItemTemplate>
                        <asp:Label ID="WStaffSalary" runat="server" Text= '<%# Bind("WStaffSalary","{0:f2}") %>'></asp:Label>
                    </ItemTemplate>
                  
                    </asp:TemplateField>
               <asp:TemplateField HeaderText="本月业绩提成(元)">
                    <ItemTemplate>
                        <asp:Label ID="daytol" runat="server" Text= '<%# Bind("daytol","{0:f2}") %>'></asp:Label>
                    </ItemTemplate>
                  
                    </asp:TemplateField>
              <asp:TemplateField HeaderText="本月工资(元)">
                    <ItemTemplate>
                        <asp:Label ID="mtol" runat="server" Text= '<%# Bind("mtol","{0:f2}") %>'></asp:Label>
                    </ItemTemplate>
                  
                    </asp:TemplateField>
             <asp:BoundField DataField="WageDate" HeaderText="业绩月份" />
             </Columns>
        </asp:GridView>
        &nbsp;
        &nbsp;&nbsp; &nbsp;
        <table width="99%" border="0" cellspacing="0" cellpadding="0">
        <tr>
        <td >
                </td>
                <td align="right">
       <uc1:PageNavigator ID="PageNavigator3" runat="server" DataId="GridViewM" ConnectionString="connstr" ShowType="Text" PageSize="3" />
                    &nbsp;
        </td>
        </tr>
        </table>
        &nbsp; &nbsp;
     
         <asp:HiddenField ID="hfuserId" runat="server" />
       
      <asp:HiddenField ID="hfdata" runat="server" />
         <asp:HiddenField ID="hfLevels" runat="server" />
         <asp:HiddenField ID="hfWagesId" runat="server" />
         <asp:HiddenField ID="hfWageDate" runat="server" />
         <asp:HiddenField ID="hfgetdep" runat="server" />
    </form>
</body>
</html>
<script language="javascript"><!--
//senfe("表格名称","奇数行背景","偶数行背景","鼠标经过背景","点击后背景");
senfe("GvDataVW","#ECF9FC","#FFFFFF","#D6F1F8");
senfe("GridViewselectday","#ECF9FC","#FFFFFF","#D6F1F8");
senfe("GridViewM","#ECF9FC","#FFFFFF","#D6F1F8");
--></script>